package com.itheima.mapper;

import com.alibaba.druid.support.monitor.annotation.MTable;
import com.github.pagehelper.Page;
import com.itheima.domain.End;
import com.itheima.domain.Statistics;
import entity.PageResult;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Result;
import org.apache.ibatis.annotations.Results;
import org.apache.ibatis.annotations.Select;

public interface ListRankingMapper {

//@Select("SELECT * FROM end where src=#{param01}")
@Select("SELECT * FROM ${param01}")
//￥有漏洞 但是参数是表名 不是属性名称所以用$
    @Results(value = {
            //id字段默认为false，表示不是主键
            //column表示数据库表字段，property表示实体类属性名。
            @Result(id = true,column = "bookid",property = "bookid"),
            @Result(column = "src",property = "src"),
            @Result(column = "grade",property = "grade")

    })
   Page<End> showall(Object obj, Integer pageNum, Integer pageSize, @Param("param01") String listname);



    @Select("SELECT * FROM statistics")
//￥有漏洞 但是参数是表名 不是属性名称所以用$
    @Results(value = {
            //id字段默认为false，表示不是主键
            //column表示数据库表字段，property表示实体类属性名。
            @Result(id = true,column = "id",property = "id"),
            @Result(column = "nature",property = "nature"),
            @Result(column = "num",property = "num")

    })
    Page<Statistics> showstatistics(Object obj, Integer pageNum, Integer pageSize);
}
